namespace SimpleWebServices.Web.Mvc
{
    using System;
    using System.Web.Mvc;

    public sealed class StatelessControllerFactory : DefaultControllerFactory
    {
        protected override IController GetControllerInstance(Type controllerType)
        {
            var controller = base.GetControllerInstance(controllerType);
            ((Controller)controller).TempDataProvider = new StatelessTempDataProvider();
            
            return controller;
        }
    }
}